import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '@/components/Layout.vue';
import { Edit } from '@element-plus/icons-vue';
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      alias: '/',
      name: 'Login',
      component: () => import('@/views/Login.vue')
    },
    {
      path: '/register',
      name: 'Register',
      component: () => import('@/views/Register.vue')
    },
    {
      path: '/admin',
      name: 'Admin',
      component: Layout,

      children: [
        {
          path: 'list',
          component: () => import('@/views/Admin/List.vue'),
        }, {
          path: 'role',
          component: () => import('../views/Admin/Role.vue'),
        },
        {
          path: 'edit/:id',
          component: () => import('../views/Admin/Edit.vue'),
        },
      ]
    },
    {
      path: '/article',
      name: 'Article',
      component: Layout,
      children: [
        {
          path: 'list',
           name: 'ArticleList',
          component: () => import('@/views/Article/List.vue'),
        },
        {
          path: 'release', 
          name: 'ArticleRelease',
          component: () => import('@/views/Article/Release.vue'),
        },
      ]
    },
    {
      path: '/tag',
      name: 'Tag',
      component: Layout,
      children: [
        {
          path: 'list',
          component: () => import('../views/Tag/List.vue'),
        },
      ]
    },
    {
      path: '/notice',
      name: 'Notice',
      component: Layout,
      children: [
        {
          path: 'list', 
          name: 'NoticeList',
          component: () => import('../views/Notice/list.vue'),
        },
        {
          path: 'release',
          component: () => import('@/views/Notice/release.vue'),
        },

      ]
    },
    {
      path: '/swipper',
      name: 'Swipper',
      component: Layout,
      children: [
        {
          path: 'list', name: 'SwipperList',
          component: () => import('@/views/Swipper/list.vue'),
        },
      ]
    },
    {
      path: '/comment',
      name: 'Comment',
      component: Layout,
      children: [
        {
          path: 'list', 
          name: 'CommentList',
          component: () => import('@/views/Comment/list.vue'),
        },
      ]
    },
    {
      path: '/user',
      name: 'User',
      component: Layout,
      children: [
        {
          path: 'list',
          name:'UserList',
          component: () => import('@/views/User/list.vue'),
        },
        {
          path: 'link',
          component: () => import('../views/User/link.vue'),
        },
      ]
    },

  ]
})

export default router
